package com.lfy.commons.config.mp;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.lfy.common.enums.BaseEnum;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.context.annotation.Configuration;

import java.util.Date;

@Configuration
public class MyBatisConfig implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("create_time",new Date(),metaObject);
        this.setFieldValByName("status", BaseEnum.regEnum.WAIT.getCode(),metaObject);
    }

    @Override
    public void updateFill(MetaObject metaObject) {

//        this.setFieldValByName("update_time",new Date(),metaObject);
    }


}
